import axios from './axios';


/**
 * 获取文件夹列表
 * @param {第几页} page 
 * @param {一页几条} limit 
 * @returns 返回文件夹数据列表
 */
export async function findFolder(page, limit) {
    return await axios.get(`/api/folder/findFolder?page=${page}&limit=${limit}`);
}


/**
 * 添加文件夹
 * @param {文件夹名字} name 
 * @returns 添加的数据
 */
export async function createFolder(name) {
    return await axios.post('/api/folder/createFolder', { name });
}

/**
 * 获取所有的文件夹
 */
export async function findFolderAllCount() {
    return await axios.get('/api/folder/findFolderAllCount');
}

/**
 * 删除文件夹
 * @param {文件夹id} id 
 */
export async function deleteFolder(id) {
    return await axios.get(`/api/folder/deleteFolder?id=${id}`);
}

/**
 * 修改文件夹
 * @param {文件夹id} id 
 * @param {文件夹名} name 
 */
export async function editFolderName(id, name) {
    return await axios.get(`/api/folder/editFolderName?id=${id}&name=${name}`);
}